package bsw.wode.service;

import java.util.Map;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.opensymphony.xwork2.ActionContext;

public abstract class BaseService {
	
	@SuppressWarnings("unchecked")
	protected Map session = ActionContext.getContext().getSession();

	private Object sessionFactory;

	public BaseService() {
	}

	public Object getSessionFactory() {
		return sessionFactory;
	}

	public void setSessionFactory(Object sessionFactory) {
		this.sessionFactory = sessionFactory;
	}
	
	
	public Object getDAO(String daoName)
	{
		ApplicationContext ctx = new ClassPathXmlApplicationContext(
		   "dao.xml"); 
		return ctx.getBean(daoName);
	}
}
